{% extends "oca/base_site.html"%}
{% block header %} 
	<a href='../../'><span>Open Contest Arena</span></a>
{% endblock %}

{% block nav %}
	<a href="../../register/">Registrar</a>
	<a href="../../">Foro</a>
	<a href="../../">Acerca de</a>
{% endblock %}
		
{% block content %}
<h1>{{contest.nombre}}</h1>
<!-- Informacion !-->
{% include 'contest/contest_info.html' %}
<!-- Problemas !-->

{% if not contest.is_pending and contest.puntaje_set.all %}<!--change later!-->
<p><strong>Problemas</strong></p>
    <ul>
    {% for problema in problemas %}
        <li> 
        Problema {{forloop.counter}}:
        {% if user_.playing %}
            {% if problema.2 %} <!-- no lo abrio !-->
                <a href="problem/{{problema.0.id}}/"> Abrir </a>
            {% endif %}
        {% else %}
            {% if not problema.2 %}
                 <a href="problem/{{problema.0.id}}/">Ver Solucion<a>
            {% endif %}
        {% endif %} 
        </li>
    {% endfor %}
    </ul>
{% endif %}
<!--{{user_.registered}}
{{user.is_authenticated}}
{{contest.is_pending}}!-->
{% if user.is_authenticated %}    
    {% if contest.is_pending %}
        {% if user_.registered %}
            <a href="../../contest/unregister/{{contest.id}}">Darse de baja</a>
        {% else %}
            Si desea participar haga click <a href="../../contest/register/{{contest.id}}/">aqui</a>  para registrarse.
        {% endif %}
    {% endif %}
{% else %}
    Para participar necesita <a href="contest/register/{{contest.id}}/">Iniciar Sesion</a> o <a href="">Registrarse</a>
{% endif %}
{% endblock %}